package com.gdou.teaching.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * http请求返回给前端的最外层的对象
 */
@ApiModel(value = "通用结果对象")
public class ResultVO<T> {
    /** 信息码 **/
    @ApiModelProperty(value = "状态码",name = "code",example = "200")
    private Integer code ;
    /** 信息 **/
    @ApiModelProperty(value = "信息",name = "msg",example = "ok")
    private String msg ;
    @ApiModelProperty(value = "数据",name = "一般是以json数据，object")
    private T data ;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public T getData() {
        return data;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public void setData(T data) {
        this.data = data;
    }

    public ResultVO() {
    }

    public ResultVO(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
